﻿@model CloudStorageLight.Core.Web.CloudSettingsVM

@{
    ViewBag.Title = "Configuration";
    Layout = "~/Views/Shared/_LayoutCloudStorage.cshtml";
}

<header class="nrm nlm">
    @Html.Partial("_CommonHeader")
</header>


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })

    <div class="container">

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgAdmins)</span>
                <div class="col-md-7">
                    @Html.TextAreaFor(x => x.Administrators, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.Administrators, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>
 
        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgAllowIPAddresses)</span>
                <div class="col-md-7">
                    @Html.TextAreaFor(x => x.AllowIPAddresses, new { @class = "form-control" })
                    <p>
                        @Html.CheckBoxFor(x => x.UseClientTokenForIPCheck)
                        <span>@(CloudStorageLight.Core.Web.ViewMessages.MsgUseClientTokenForIPCheck)</span>
                    </p>
                    @Html.ValidationMessageFor(x => x.AllowIPAddresses, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgAcceptMailAddressPattern)</span>
                <div class="col-md-7">
                    @Html.TextAreaFor(x => x.AcceptMailAddressPattern, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.AcceptMailAddressPattern, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgGuestMailAddressPattern)</span>
                <div class="col-md-7">
                    @Html.TextAreaFor(x => x.GuestMailAddressPattern, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.GuestMailAddressPattern, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgClientDownloadPage)</span>
                <div class="col-md-7">
                    @Html.TextBoxFor(x => x.ClientDownloadPage, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.ClientDownloadPage, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgAuthTicketTimeout)</span>
                <div class="col-md-7">
                    @Html.TextBoxFor(x => x.AuthTicketTimeout, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.AuthTicketTimeout, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanFullTextSearch)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanFullTextSearch)
                    @Html.ValidationMessageFor(x => x.CanFullTextSearch, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanCreateSelfAccount)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanCreateSelfAccount)
                    @Html.ValidationMessageFor(x => x.CanCreateSelfAccount, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanUseBackupFunction)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanUseBackupFunction)
                    @Html.ValidationMessageFor(x => x.CanUseBackupFunction, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanUseAutoPassword)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanUseAutoPassword)
                    @Html.ValidationMessageFor(x => x.CanUseAutoPassword, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanUserUserPasswordProtec)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanUseUserPasswordProtect)
                    @Html.ValidationMessageFor(x => x.CanUseUserPasswordProtect, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgFileTransfer)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanUseTransferFile)
                    @Html.ValidationMessageFor(x => x.CanUseTransferFile, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        @if (CloudStorageLight.Core.SystemSettings.Instance.UseRMS)
        {
            <div style="margin:20px;">
                <div class="row-same-height">
                    <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanUseAzureRMS)</span>
                    <div class="col-md-7">
                        @Html.CheckBoxFor(x => x.CanUseRMS)
                        @Html.ValidationMessageFor(x => x.CanUseRMS, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
        }

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgCanUseGuestAccount)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x => x.CanUseGuestAccount)
                    @Html.ValidationMessageFor(x => x.CanUseGuestAccount, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div style="margin:20px;">
            <div class="row-same-height">
                <span class="col-md-5 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgUseMicrosoftAccount)</span>
                <div class="col-md-7">
                    @Html.CheckBoxFor(x =>x.CanUseMicrosoftAccount)
                    @Html.ValidationMessageFor(x => x.CanUseMicrosoftAccount, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <hr />
        <div style="margin-top:50px;">
            @Html.CheckBoxFor(x => x.AzureAdMode)
            @(CloudStorageLight.Core.Web.ViewMessages.MsgAzureAdMode)
            @Html.ValidationMessageFor(x => x.AzureAdMode, "", new { @class = "text-danger" })
        </div>

        <div style="margin:20px;">
            <span class="col-md-2 control-label">Authority</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.Authority, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.Authority, "", new { @class = "text-danger" })
            </div>
            <span class="col-md-2 control-label">Client ID</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.CloudStorageLightClientId, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.CloudStorageLightClientId, "", new { @class = "text-danger" })
            </div>
            <span class="col-md-2 control-label">App Key</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.CloudStorageLightAppKey, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.CloudStorageLightAppKey, "", new { @class = "text-danger" })
            </div>
            <span class="col-md-2 control-label">Tenant ID</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.TenantId, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.TenantId, "", new { @class = "text-danger" })
            </div>
            <span class="col-md-2 control-label">RMS Extranet Url</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.RmsExtranetUrl, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.RmsExtranetUrl, "", new { @class = "text-danger" })
            </div>
            <span class="col-md-2 control-label">RMS Intranet Url</span>
            <div class="col-md-10">
                @Html.TextBoxFor(x => x.RmsIntranetUrl, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.RmsIntranetUrl, "", new { @class = "text-danger" })
            </div>
        </div>

        <hr />
        <div style="margin-top:50px;">
            @if (Model.IsLocked)
            {
                <input type="submit" name="submitButton" disabled="disabled" value="@(CloudStorageLight.Core.Web.ViewMessages.MsgRegister)" class="btn btn-default" />
            }
            else
            {
                <input type="submit" name="submitButton" value="@(CloudStorageLight.Core.Web.ViewMessages.MsgRegister)" class="btn btn-default" />
            }
        </div>
    </div>
    <div class="row">
        <div class="row-same-height">
            <div class="col-md-7">
            </div>
            <div class="col-md-5">
                @Html.ActionLink(CloudStorageLight.Core.Web.ViewMessages.CmdDeleteCloudAccount, "DeleteCloudAccount")
            </div>
        </div>
    </div>


}

@section scripts{

}
